<template>
  <div class="content">
    <h2 class="title">热门精选</h2>
    <div class="list">
        <template v-for="(item,index) in houseList" :key="index">
            <HouseItemV1 :item-data="item.data" @item-click="itemClick"/>
        </template>
    </div>
  </div>
</template>
<script setup>

    import useHomeStore from '@/store/modules/home';
    import { storeToRefs } from 'pinia';
    import HouseItemV1 from "@/components/house-item-v1/house-item-v1.vue"
import router from '@/router';

    const homeStore = useHomeStore()
    const { houseList } = storeToRefs(homeStore)
    const itemClick = (itemData) =>{
        router.push("/detail/"+itemData.houseId)
        console.log("Dasdas",itemData);
    }
</script>
<style lang="less" scoped>
/*局部css 支持css3 可以改变elementUI组件的样式 且组件样式调整只在本页面生效**/
/*主样式*/
.content {
    padding: 10px 8px;
    .title{
        font-size: 22px;
        padding: 10px;
    }
}
.list{
    display: flex;
    flex-wrap: wrap;
}
</style>
